cmake_minimum_required(VERSION 3.21.1)

project(ysMusic2 VERSION 0.1 LANGUAGES CXX)

find_package(Qt5 REQUIRED COMPONENTS Core Quick Qml LinguistTools)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(BIN_NAME ysMusic2)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)


set(TS_FILES source/language/zh_CN.ts)
file(GLOB_RECURSE SRCS RELATIVE  ${CMAKE_CURRENT_SOURCE_DIR} LINK_DIRECTORIES false
     ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/.h
    )
list(APPEND SRCS source/assets/assets.qrc)


add_executable(${BIN_NAME})
target_sources(${BIN_NAME} PRIVATE ${SRCS} ${TS_FILES})



qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR}/source ${TS_FILES})

target_link_libraries(${BIN_NAME} PRIVATE 
    Qt5::Core 
    Qt5::Quick
    Qt5::Qml
    )


set_target_properties(${BIN_NAME} PROPERTIES
    MACOSX_BUNDLE_GUI_IDENTIFIER blog.yxqin.top
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

